package com.yangyang.lamviarm.entity;

import java.util.HashMap;
import java.util.List;

import com.yangyang.lamviarm.util.TypeEnum;

public class JPredicateDef extends JBaseDef {

	private TypeEnum[] mParamType;
	public static HashMap<String, JPredicateDef> mapNamePredicate;

	public JPredicateDef(List<String> lines) {
		super(lines.get(0));
		this.mParamType = new TypeEnum[lines.size() - 1];
		for (int i = 1; i < lines.size(); i++) {
			this.mParamType[i - 1] = TypeEnum.parseType(lines.get(i));
		}

		if (mapNamePredicate == null)
			mapNamePredicate = new HashMap<String, JPredicateDef>();
		mapNamePredicate.put(this.mName, this);
	}

	public TypeEnum[] getParamType() {
		return this.mParamType;
	}

	@Override
	public String toString() {
		String msg = this.mName;
		for (TypeEnum type : this.mParamType)
			msg += type;
		return msg;
	}
}
